package recompenses;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "recompense")
public class Recompense implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;


	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "code_rec")
	private int code_rec = -1;
	
	
	@Column(name = "titre" , unique = true)
	private String titre = "titre";	
	
    @OneToMany(mappedBy = "recompense", cascade = { CascadeType.REMOVE }) 
    private Set<RecompenserFilm> film = new HashSet<RecompenserFilm>(); 

    @OneToMany(mappedBy = "recompense", cascade = { CascadeType.REMOVE }) 
    private Set<RecompenserPersonne> personne = new HashSet<RecompenserPersonne>(); 
	
    public Recompense(){}
    
	public Recompense (String titre)
	{
		this.titre = titre;
	}
	
	public int getCode_rec() {
		return code_rec;
	}



	public void setCode_rec(int code_recFilm) {
		this.code_rec= code_recFilm;
	}



	public String getTitre() {
		return titre;
	}



	public void setTitre(String titre) {
		this.titre = titre;
	}

	public Set<RecompenserFilm> getFilm() {
		return film;
	}

	public void setFilm(Set<RecompenserFilm> film) {
		this.film = film;
	}

	public Set<RecompenserPersonne> getPersonne() {
		return personne;
	}

	public void setPersonne(Set<RecompenserPersonne> personne) {
		this.personne = personne;
	}
	
	
	
}
